package org.feiye.studyday07.practise;

import java.util.Scanner;

public class Array {

	public static void main(String[] args) {
		// 书上数组练习3
		Scanner in = new Scanner(System.in);
		int[] arr = new int[10];
		System.out.println("请输入" + arr.length + "个数字：");
		for (int i = 0; i < arr.length; i++) {
			arr[i] = in.nextInt();
		}
		int i = 0, j = 0, k = 0, l = 0, m = 0;
		System.out.print("输入的" + arr.length + "个数为:");
		for (i = 0; i < arr.length; i++) {
			System.out.print(arr[i] + "  ");
			if (arr[i] == 1) {
				j++;
			} else if (arr[i] == 2) {
				k++;
			} else if (arr[i] == 3) {
				l++;
			} else {
				m++;
			}
		}
		System.out.println("\n数字1的个数为：" + j);
		System.out.println("数字2的个数为：" + k);
		System.out.println("数字3的个数为：" + l);
		System.out.println("非法数字的个数为：" + m);
	}

}
